package com.zxq.frame.core;

import com.zxq.frame.core.rabbitmq.IRabbitPublishKey;
import lombok.Data;
import org.apache.xmlbeans.impl.util.HexBin;


@Data
public class ExchangeDTO extends PacketDTO implements IRabbitPublishKey {

    /**
     * 指令id，会和iot_cmd表内的cmd_hex字段对应起来，完成解析，很重要
     */
    String cmdHex;


    @Override
    public String webPublishToMicroService() {
        return "web-" + frameId;
    }

    @Override
    public String devicePublishToMicroService() {
        return "network-" + frameId;
    }

    @Override
    public String getStringFormatMsg() {

        return String.format("devId:%s cmdHex:%s frame:%s",devId, cmdHex, HexBin.bytesToString(data));
    }
}
